<template>
	<view class="page">
		<!-- 列表 -->
		<view class="list-wrap">
			<view class="table-wrap">
				<view class="th">
					<view class="td">
						类型
					</view>
					<view class="td">
						方案号
					</view>
					<view class="td">
						分数
						/艺术分
					</view>
					<view class="td">
						时间
					</view>
					<view class="td">
						操作
					</view>
				</view>
				<view class="tr" v-for="(item,index) in 10" :key="index">
					<view class="td">
						普通文科
					</view>
					<view class="td">
						003-1
					</view>
					<view class="td">
						110/584
					</view>
					<view class="td">
						2018/12/14 12:54:45
					</view>
					<view class="td">
						<view class="btn">
							查看
						</view>
						<view class="btn" @click.stop="popupToggle">
							授权
						</view>
						<view class="btn" @click="del">
							删除
						</view>
					</view>
				</view>
			</view>
		</view>
		
		<!-- 授权弹窗 -->
		<view class="popup-wrap" v-if="popupIsShow">
			<view class="mask" @click.stop="popupToggle"></view>
			<view class="popup-cont-wrap">
				<view class="popup-title">
					授权机构
				</view>
				<view class="popup-cont">
					<view class="row">
						<view class="title">
							省份
						</view>
						<view class="select">
							<picker @change="bindPickerChange" :value="index" :range="array">
								<view class="uni-input" v-if="index == -1">请选择考试类型</view>
								<view class="uni-input" v-else>{{array[index]}}</view>
							</picker>
							<view class="iconfont iconxxjtfull"></view>
						</view>
					</view>
					<view class="row">
						<view class="title">
							市区
						</view>
						<view class="select">
							<picker @change="bindPickerChange" :value="index" :range="array">
								<view class="uni-input" v-if="index == -1">请选择</view>
								<view class="uni-input" v-else>{{array[index]}}</view>
							</picker>
							<view class="iconfont iconxxjtfull"></view>
						</view>
					</view>
					<view class="row">
						<view class="title">
							机构
						</view>
						<view class="select">
							<picker @change="bindPickerChange" :value="index" :range="array">
								<view class="uni-input" v-if="index == -1">请选择</view>
								<view class="uni-input" v-else>{{array[index]}}</view>
							</picker>
							<view class="iconfont iconxxjtfull"></view>
						</view>
					</view>
					<view class="row">
						<view class="title">
							指导老师
						</view>
						<view class="select">
							<input type="text" value="" placeholder="请填写指导老师" placeholder-class="placeholder" />
						</view>
					</view>
					<view class="btn-wrap">
						<view class="cancel-btn" @click.stop="popupToggle">
							取消
						</view>
						<view class="confirm-btn">
							确定
						</view>
					</view>
				</view>
			</view>
		</view>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				popupIsShow:false,//授权弹窗是否显示
				index: -1,
				array: ['重庆', '四川', '北京', '上海'],
			}
		},
		methods: {
			bindPickerChange(e) {
				console.log('picker发送选择改变，携带值为', e.target.value)
				this.index = e.target.value
			},
			// 授权
			popupToggle(){
				let that = this;
				that.popupIsShow = !that.popupIsShow;
			},
			// 删除
			del(){
				uni.showModal({
				    title: '提示',
				    content: '确定删除？',
				    success: function (res) {
				        if (res.confirm) {
				            console.log('用户点击确定');
				        } else if (res.cancel) {
				            console.log('用户点击取消');
				        }
				    }
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import 'myVolunteerProgram.scss';
	@import '@/common/icon/iconfont.css';
</style>
